home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group94b.txt
/
000067_icon-group-sender _Mon Sep 26 14:02:29 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1995-02-09
|
2KB
Received: by cheltenham.cs.arizona.edu; Mon, 26 Sep 1994 08:48:09 MST
To: icon-group-l@cs.arizona.edu
Date: Mon, 26 Sep 1994 14:02:29 GMT
From: goer@quads.uchicago.edu (Richard L. Goerwitz)
Message-Id: <1994Sep26.140229.22474@midway.uchicago.edu>
Organization: University of Chicago
Sender: icon-group-request@cs.arizona.edu
References: <940926100948@ibm3090.bham.ac.uk>
Reply-To: goer@midway.uchicago.edu
Subject: Re: sort() but descending?
Errors-To: icon-group-errors@cs.arizona.edu
Gabriel Landini writes:
>
>I would like to sort that list from more frequent to less frequent, but I
>cannot find the way to do it. Any ideas?
>Does the sort(0 and sortf() only sort in ascending order?
>thanks
The sort order is predefined, in ascending order. Presumably the reason
for this so that we don't have sorted lists floating around with different
sort orders. One size fits all.
Of course it's easy enough to use elements from sorted lists in any order.
In Icon you have ready access to any element within a list. E.g. for as-
cending order:
l := sort(x)
every element := !l do {
do something with element
...
Or, if you don't need to keep l around -
every element := !sort(x) do {
do something with element
...
For descending order:
l := sort(x)
every i := *x to 1 by -1 do {
do something with x[i]
...
Does this seem to help any?
--
-Richard L. Goerwitz goer%midway@uchicago.bitnet
goer@midway.uchicago.edu rutgers!oddjob!ellis!goer